﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Axis.Dao.Core;
using System.Text;
using Axis.BusinessObject.Response;
using Axis.BusinessObject.Core;
using PhuLeBooze.Global;
using Axis.BusinessObject.Research;
using Axis.Dao.Research;

namespace PhuLeBooze.Views.Project
{
    public partial class ListQuestion : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                StringBuilder resultProject = new StringBuilder();
                CResearchDao CResearch = new CResearchDao();
                IList<CProject> listProject = CResearch.GetProject(string.Format("<InputValue UserID='{0}' SecrectToken='{1}'/>", CSecurity.USER_ID, CSecurity.SECRECT_TOKEN));
                ddlProjectList.DataSource = listProject;
                ddlProjectList.DataTextField = "Name";
                ddlProjectList.DataValueField = "ID";
                ddlProjectList.DataBind();
                ddlProjectList.Items.Insert(0, new ListItem("(Tất cả)", ""));
               
                StringBuilder resultQuestionType = new StringBuilder();
                IList<CListData> listQuestionType = new CCore().GetListData("QuestionnaireType");

                ddlQuestionType.DataSource = listQuestionType;
                ddlQuestionType.DataTextField = "Name";
                ddlQuestionType.DataValueField = "ID";
                ddlQuestionType.DataBind();
                ddlQuestionType.Items.Insert(0, new ListItem("(...)", ""));
                ddlQuestionType.Items.Insert(ddlQuestionType.Items.Count, new ListItem("Kết thúc", "-1"));

                IList<CListData> listDependentType = new CCore().GetListData("DependentType");
                ddlDependentType.DataSource = listDependentType;
                ddlDependentType.DataTextField = "Name";
                ddlDependentType.DataValueField = "Value";
                ddlDependentType.DataBind();
            }
        }
    }
}